package com.fr71.project.dm.domain;

import com.fr71.common.utils.DateUtils;

import java.util.Date;

// 支付宝支付配置 回调地址
public class Beans {
    public static final String ALIPAY_RESULT_URL = "http://116.198.35.29:60001/open/alipayResult";
    // 微信支付配置
    public static final String WXPAY_RESULT_URL = "";

    //TODO
    public static final String BASE_DOWNLOAD_URL = "https://m21-bucket.oss-cn-qingdao.aliyuncs.com";

    public static class PayResultBean {
        private int code = -1;
        private String trade_no = "";
        private String payurl = "";

        public PayResultBean() {}

        public PayResultBean(int code, String trade_no, String payurl) {
            this.code = code;
            this.trade_no = trade_no;
            this.payurl = payurl;
        }

        public int getCode() { return code; }
        public void setCode(int code) { this.code = code; }
        
        public String getTrade_no() { return trade_no; }
        public void setTrade_no(String trade_no) { this.trade_no = trade_no; }
        
        public String getPayurl() { return payurl; }
        public void setPayurl(String payurl) { this.payurl = payurl; }
    }

    public static class HomeDataBean {
        private String title;
        private Long value;

        public HomeDataBean() {}

        public HomeDataBean(String title, Long value) {
            this.title = title;
            this.value = value;
        }

        public String getTitle() { return title; }
        public void setTitle(String title) { this.title = title; }
        
        public Long getValue() { return value; }
        public void setValue(Long value) { this.value = value; }
    }

    public static class QQSignBean {
        //qq
        private String qq = "";
        //总签到次数
        private int totalSignNumber = 0;
        //连续签到次数
        private int acceptSignNumber = 0;
        //最后一次签到时间
        private long lastSignTime;
        //总积分数量
        private long totalCoin;

        public QQSignBean(String qq, int totalSignNumber, int acceptSignNumber, long lastSignTime, long totalCoin) {
            this.qq = qq;
            this.totalSignNumber = totalSignNumber;
            this.acceptSignNumber = acceptSignNumber;
            this.lastSignTime = lastSignTime;
            this.totalCoin = totalCoin;
        }

        public QQSignBean() {}

        public QQSignBean(long lastSignTime, long totalCoin) {
            this.lastSignTime = lastSignTime;
            this.totalCoin = totalCoin;
        }

        @Override
        public String toString() {
            return "你目前总积分：" + totalCoin + "/r总签到次数：" + totalSignNumber + "/r连续签到次数：" + acceptSignNumber + "/r最后签到时间：" +
                    DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date(lastSignTime)) +
                    "/r积累一定的积分可以兑换工具箱与插件激活码。";
        }

        public String getQq() { return qq; }
        public void setQq(String qq) { this.qq = qq; }

        public int getTotalSignNumber() { return totalSignNumber; }
        public void setTotalSignNumber(int totalSignNumber) { this.totalSignNumber = totalSignNumber; }

        public int getAcceptSignNumber() { return acceptSignNumber; }
        public void setAcceptSignNumber(int acceptSignNumber) { this.acceptSignNumber = acceptSignNumber; }

        public long getLastSignTime() { return lastSignTime; }
        public void setLastSignTime(long lastSignTime) { this.lastSignTime = lastSignTime; }

        public long getTotalCoin() { return totalCoin; }
        public void setTotalCoin(long totalCoin) { this.totalCoin = totalCoin; }
    }

    //商品列表实体
    public static class ResultShopBean {
        //商品名称
        private final String title;
        //商品类型
        private final int type;
        //商品价格
        private final String price;
        //生成订单使用的key
        private final Long priceCode;

        public ResultShopBean(String title, int type, String price, Long priceCode) {
            this.title = title;
            this.type = type;
            this.price = price;
            this.priceCode = priceCode;
        }

        public String getTitle() { return title; }
        public int getType() { return type; }
        public String getPrice() { return price; }
        public Long getPriceCode() { return priceCode; }
    }

    public static class EtcBean {
        private final String title;
        private final String downloadUrl;
        private final String downloadAttUrl;

        public EtcBean(String title, String downloadUrl, String downloadAttUrl) {
            this.title = title;
            this.downloadUrl = downloadUrl;
            this.downloadAttUrl = downloadAttUrl;
        }

        public String getTitle() { return title; }
        public String getDownloadUrl() { return downloadUrl; }
        public String getDownloadAttUrl() { return downloadAttUrl; }
    }
}